Home

Operator Usage

Name

dump

Description

dump(|*>) input-sp
dump(|op: op1> + |op: op2> + ... + |op: opn>) input-sp
dump(|ops: op3 op2 op1>) input-sp
when given the |*> ket, dump prints out the knowledge for all supported operators for the given kets
when given kets with prefix "op: " then only print out knowledge for those operators for the given kets
when given kets with prefix "ops: " then print out the knowledge for the operator sequence applied to the given kets
NB: empty rules are ignored and not printed out
NB: simple operators are supported in the operator sequence case


Examples

-- first learn some toy knowledge:
age |Fred> => |37>
friends |Fred> => |Rob> + |Mary> + |Matt> + |Sam>

age |Sam> => |41>
friends |Sam> => |Fred> + |Liz> + |Emma>

-- now see all known knowledge:
dump(|*>) rel-kets[*]
    age|Fred> => |37>
    friends|Fred> => |Rob> + |Mary> + |Matt> + |Sam>

    age|Sam> => |41>
    friends|Sam> => |Fred> + |Liz> + |Emma>

-- now see just the ages:
dump(|op: age>) rel-kets[*]
    age|Fred> => |37>

    age|Sam> => |41>

-- now see ages of friends using an operator sequence:
dump(|ops: age friends>) rel-kets[*]
    age friends|Fred> => |41>

    age friends|Sam> => |37>

-- now see friends of friends using an operator sequence:
dump(|ops: friends friends>) rel-kets[*]
    friends friends|Fred> => |Fred> + |Liz> + |Emma>

    friends friends|Sam> => |Rob> + |Mary> + |Matt> + |Sam>

-- simple operators are also supported:
-- eg, how many friends:
dump(|ops: how-many friends>) rel-kets[*]
    how-many friends|Fred> => |number: 4>

    how-many friends|Sam> => |number: 3>

    how-many friends|*> => |number: 0>


See also

recursive-dump, shell-dump, filter

Operator type

miscellaneous element, context function 1